package main

import (
	"fmt"
)

func main()  {

	var arr = []int{1,2,3,4,5,6,7,8,9}
	var num = 2
	testFan(&arr,num)
	fmt.Println(arr)
}

func testFan(arr *[]int, num int)  {

	for i,j:=0,len(*arr)-1;i<j;{
		(*arr)[i],(*arr)[j] = (*arr)[j],(*arr)[i]
		i++
		j--
	}

	for i,j:=0,num-1;i<j;{
		(*arr)[i],(*arr)[j] = (*arr)[j],(*arr)[i]
		i++
		j--
	}

	for i,j:=num,len(*arr)-1;i<j;{
		(*arr)[i],(*arr)[j] = (*arr)[j],(*arr)[i]
		i++
		j--
	}
	return
}
